<!doctype html>
<html class="no-js" lang="zxx" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title>个人信息</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" type="image/x-icon" href="http://localhost:8080/assets/img/favicon.ico">
    <script src="http://localhost:8080/assets/js/main.js"></script>

    <!-- CSS here -->
    <link rel="stylesheet" href="http://localhost:8080/assets/css/bootstrap.min.css">
    <link rel="stylesheet" href="http://localhost:8080/assets/css/owl.carousel.min.css">
    <link rel="stylesheet" href="http://localhost:8080/assets/css/slicknav.css">
    <link rel="stylesheet" href="http://localhost:8080/assets/css/animate.min.css">
    <link rel="stylesheet" href="http://localhost:8080/assets/css/magnific-popup.css">
    <link rel="stylesheet" href="http://localhost:8080/assets/css/fontawesome-all.min.css">
    <link rel="stylesheet" href="http://localhost:8080/assets/css/themify-icons.css">
    <link rel="stylesheet" href="http://localhost:8080/assets/css/slick.css">
    <link rel="stylesheet" href="http://localhost:8080/assets/css/nice-select.css">
    <link rel="stylesheet" href="http://localhost:8080/assets/css/style.css">
</head>
<body>
<div th:replace="template.html::header"></div>
<main>
    <!-- Hero Area Start-->
    <div class="slider-area gray-bg position-relative">
        <div class="single-slider d-flex align-items-center slider-height2">
            <div class="container">
                <div class="row">
                    <div class="col-xl-12">
                        <div class="hero-caption hero-caption2">
                            <h2 th:text="${u.getName()} + '的个人信息'"></h2>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- Hero Area End -->

    <div class="job_details_area section-bg2">
        <div class="container">
            <div class="row">
                <div class="col-lg-8">
                    <div class="apply_job_form white-bg" style="margin-top: 0; padding-top: 0">
                        <h4 th:text="${u.getName()}"></h4>
                        <form method="post" action="modify-user-info">
                            <input style="display: none" name="id" th:value="${u.getId()}">
                            <p th:style="${modify_info_style}" th:text="${modify_info}"></p>
                            <div class="row">
                                <div class="col-md-6">
                                    <p>名字</p>
                                    <div class="input_field">
                                        <input th:disabled="${!user.getRole().equals('admin') && u.getId() != user.getId()}"
                                               id="name" name="name"
                                               th:value="${u.getName()}"/>
                                    </div>
                                </div>
                                <div class="col-md-6">
                                    <p>账号</p>
                                    <div class="input_field">
                                        <input th:disabled="${!user.getRole().equals('admin') && u.getId() != user.getId()}"
                                               id="account" name="account"
                                               th:value="${u.getAccount()}"/>
                                    </div>
                                </div>
                                <div class="col-md-12">
                                    <p>电话</p>
                                    <div class="input_field">
                                        <input th:disabled="${!user.getRole().equals('admin') && u.getId() != user.getId()}"
                                               id="phone" name="phone"
                                               th:value="${u.getPhone()}"/>
                                    </div>
                                </div>
                                <div th:if="${user.getRole().equals('admin') || u.getId() == user.getId()}"
                                     class="col-md-12">
                                    <div class="submit_btn">
                                        <button class="boxed-btn3 w-100" type="submit">点击编辑</button>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
                <div class="col-lg-4">
                    <div class="job_sumary">
                        <div class="summery_header">
                            <h3 th:text="${u.getName() + '的房屋'}"></h3>
                        </div>
                        <div class="job_content">
                            <ul>
                                <li>房屋数量: <span th:text="${houses.size()}"></span></li>
                            </ul>
                        </div>
                    </div>
                </div>
                <div class="col-lg-8" style="margin-top: 10px">
                    <div th:if="${u.getId() == user.getId()}" class="apply_job_form white-bg"
                         style="margin-top: 0; padding-top: 0">
                        <h4>修改密码</h4>
                        <p th:style="${aStyle}" th:text="${a}"></p>
                        <form method="post" action="modify-user-password">
                            <input style="display: none" name="id" th:value="${u.getId()}">
                            <div class="row">
                                <div class="col-md-6">
                                    <p>新密码</p>
                                    <div class="input_field">
                                        <input name="password" type="password"/>
                                    </div>
                                </div>
                                <div class="col-md-6">
                                    <p>确认新密码</p>
                                    <div class="input_field">
                                        <input name="repassword" type="password"/>
                                    </div>
                                </div>
                                <div class="col-md-12">
                                    <div class="submit_btn">
                                        <button class="boxed-btn3 w-100" type="submit">修改密码</button>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
            <div th:if="${houses.size() > 0}" class="row">
                <div class="col-lg-8">
                    <div class="job_details_header">
                        <div class="apply_job_form white-bg">
                            <h4>房屋信息</h4>
                            <div class="row" id="list">
                                <div class="jobs_left d-flex align-items-center" th:each="house : ${houses}">
                                    <div class="thumbx">
                                        <a th:href="'rent-house?id=' + ${house.getId()}">
                                            <img th:src="${house.getPic()}" alt=""/>
                                        </a>
                                    </div>
                                    <div class="jobs_conetent">
                                        <a th:href="'rent-house?id=' + ${house.getId()}"><h4
                                                th:text="${house.getName()}"></h4>
                                        </a>
                                        <div class="links_locat d-flex align-items-center">
                                            <div class="location">
                                                <p><i class='fas fa-map-marker-alt'>
                                                </i><a th:text="${house.getLocation()}"></a></p>
                                            </div>
                                            <div class="location">
                                                <p>
                                                    <i class="far">
                                                        <svg width="18" height="18" viewBox="0 0 48 48" fill="none"
                                                             xmlns="http://www.w3.org/2000/svg">
                                                            <path d="M4 14C4 12.8954 4.89543 12 6 12H42C43.1046 12 44 12.8954 44 14V40C44 41.1046 43.1046 42 42 42H6C4.89543 42 4 41.1046 4 40V14Z"
                                                                  fill="none" stroke="#aeadb2" stroke-width="4"
                                                                  stroke-linejoin="round"/>
                                                            <path d="M19 19L24 24L29 19" stroke="#aeadb2"
                                                                  stroke-width="4" stroke-linecap="round"
                                                                  stroke-linejoin="round"/>
                                                            <path d="M18 25H30" stroke="#aeadb2" stroke-width="4"
                                                                  stroke-linecap="round" stroke-linejoin="round"/>
                                                            <path d="M18 31H30" stroke="#aeadb2" stroke-width="4"
                                                                  stroke-linecap="round" stroke-linejoin="round"/>
                                                            <path d="M24 25V35" stroke="#aeadb2" stroke-width="4"
                                                                  stroke-linecap="round" stroke-linejoin="round"/>
                                                            <path d="M8 6H40" stroke="#aeadb2" stroke-width="4"
                                                                  stroke-linecap="round" stroke-linejoin="round"/>
                                                        </svg>
                                                    </i>
                                                    <a th:text="${house.getPrice()} +元+' / '+月"></a>
                                                </p>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-lg-8">
                    <div class="job_filter white-bg">
                        <div class="form_inner white-bg">
                            <div class="row">
                                <div style="display: flex;margin: auto;" class="single_field">
                                    <input onclick="add(-1)" class="boxed-btn3" style="margin-right: 20px" value="上一页">
                                    <input onchange="change(this.value)" id="pager" type="number"
                                           value="1" min="1" disabled>
                                    <input onclick="add(1)" class="boxed-btn3" style="margin-left: 20px" value="下一页">
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</main>
<div th:replace="template.html::footer"></div>
<!-- Scroll Up -->
<div id="back-top">
    <a title="Go to Top" href="#"><i class="fas fa-level-up-alt"></i></a>
</div>
</body>
</html>